package cn.dceast.former.controller;

import cn.dceast.common.data.RtnData;
import cn.dceast.common.utils.DataUtil;
import cn.dceast.former.model.EyeModelIndustry;
import cn.dceast.former.service.EyeIndustryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by fanbo on 2017-07-18.
 * 模型行业
 */
@Controller
@RequestMapping("/eyeIndustryController")
@Api(tags = {"eyeIndustryController"})
public class EyeIndustryController {
    public static final Logger logger = LoggerFactory.getLogger(EyeIndustryController.class);

    @Autowired
    private EyeIndustryService eyeIndustryService;

    /**
     * 行业列表

     * @return
     */
    @ApiOperation(value = "行业列表", notes = "行业列表")
    @RequestMapping(value = "/getIndustryList.do", method = RequestMethod.GET)
    @ResponseBody
    public RtnData getIndustryList(){
        Map<String,Object> paramMap = new HashMap<>();


        List<EyeModelIndustry> industryList = eyeIndustryService.getIndustryList(paramMap);
        if(DataUtil.isListNotNull(industryList)){
            Map<String,Object> returnMap = new HashMap<>();
            returnMap.put("list",industryList);
            return RtnData.ok(returnMap);
        }
        return RtnData.fail("","查询行业失败");
    }
}
